{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "332126f9-3524-4223-bcc6-24b9818b77b5",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "from mythic import mythic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "abfa531f-5e7a-400b-910c-92a62106ccbe",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "mythic_instance = await mythic.login(\n",
    "        username=\"mythic_admin\",\n",
    "        password=\"mythic_password\",\n",
    "        server_ip=\"mythic_nginx\",\n",
    "        server_port=7443,\n",
    "        timeout=-1\n",
    "    )\n",
    "print(mythic_instance)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fa3c9e18-12b3-4b88-9157-c1b920fc64c7",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# ########## Start or Stop C2 Profile ###########\n",
    "resp = await mythic.start_stop_c2_profile(mythic=mythic_instance, c2_profile_name=\"http\", action=\"start\")\n",
    "print(resp)\n",
    "resp = await mythic.start_stop_c2_profile(mythic=mythic_instance, c2_profile_name=\"http\", action=\"stop\")\n",
    "print(resp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "77b89409-31c8-44d8-877f-bec19f261e01",
   "metadata": {},
   "outputs": [],
   "source": [
    "# ########## Create a Saved C2 Instance ###########\n",
    "resp = await mythic.create_saved_c2_instance(mythic=mythic_instance, c2_profile_name=\"http\",\n",
    "                                             instance_name=\"my custom c2 values\", c2_parameters={\n",
    "            \"callback_host\": \"https://abc.com\",\n",
    "            \"callback_port\": 80,\n",
    "            \"headers\": {\"User-Agent\": \"bob\"}\n",
    "        })\n",
    "print(resp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d12e71c7-2e48-4733-b416-d7abd2f3e503",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
